import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import TabBar from '../components/common/TabBar.vue';
import Email from '../components/common/Email.vue';
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    components: {
      default:Home,
      tabBar: TabBar,
      email: Email
    },
    meta: {
      title: "首页"
    }
  },
  {
    path: '/course',
    name: 'Course',
    // route level code-splitting
    components:{
      default: () => import( /* webpackChunkName: "Course" */ '../views/Course1.vue'),
      tabBar: TabBar,
      email: Email
    },
    meta: {
      title: "课程"
    }
  },
  {
    path: '/courseDate',
    name: 'CourseDate',
    // route level code-splitting
    components: {
      default: () => import( /* webpackChunkName: "CourseDate" */ '../views/CourseDate.vue'),
      tabBar: TabBar,
      email: Email
    },
    meta: {
      title: "课程记录"
    }
  },
  {
    path: '/exercise',
    name: 'Exercise',
    // route level code-splitting
    components: {
      default: () => import( /* webpackChunkName: "Exercise" */ '../views/Exercise.vue'),
      tabBar: TabBar,
      email: Email
    },
    meta: {
      title: "练习"
    }
  },
  {
    path: '/login',
    name: 'Login',
    // route level code-splitting
    components: {
      default: () => import( /* webpackChunkName: "Login" */ '../views/Login.vue'),
      email: Email
    },
    meta:{
      title:"登录"
    }
  },
  {
    path: '/oneToOne',
    name: 'OneToOne',
    // route level code-splitting
    components: {
      default: () => import( /* webpackChunkName: "OneToOne" */ '../views/OneToOne.vue'),
    },
    meta:{
      title:"一对一"
    }
  },
  {
    path: '/MineInfo',
    name: 'MineInfo',
    components: {
      default: () => import( /* webpackChunkName: "MineInfo" */ '../views/MineInfo.vue'),
    },
    meta:{
      title:"个人信息"
    }
  },
  {
    path: '/updateUserInfo',
    name: 'UpdateUserInfo',
    components: {
      default: () => import( /* webpackChunkName: "UpdateUserInfo" */ '../views/UpdateUserInfo.vue'),
    },
    meta:{
      title:"修改个人信息"
    }
  },
  {
    path: '/teacherInfo',
    name: 'TeacherInfo',
    // route level code-splitting
    components: {
      default: () => import( /* webpackChunkName: "TeacherInfo" */ '../views/TeacherInfo.vue'),
    },
    meta:{
      title:"教师详情"
    }
  },
  {
    path: '/ask',
    name: 'Ask',
    // route level code-splitting
    components: {
      default: () => import( /* webpackChunkName: "Ask" */ '../views/Ask.vue'),
    },
    meta:{
      title:"预约"
    }
  },
  {
    path: '/register',
    name: 'register',
    // route level code-splitting
    components: {
      default: () => import( /* webpackChunkName: "register" */ '../views/Register.vue'),
      email: Email
    },
    meta:{
      title:"验证码登录"
    }
  },
  {
    path: '/messageToUs',
    name: 'MessageToUs',
    // route level code-splitting
    components: {
      default: () => import( /* webpackChunkName: "MessageToUs" */ '../views/MessageToUs.vue'),
    },
    meta:{
      title:"验证码登录"
    }
  },
  {
    path: '/mine',
    name: 'Mine',
    // route level code-splitting
    components: {
      default: () => import( /* webpackChunkName: "Mine" */ '../views/Mine.vue'),
      tabBar: TabBar,
      email: Email
    },
    meta:{
      title:"我的",
      login_require:true
    }
  },
  {
    path: '/search',
    name: 'Search',
    // route level code-splitting
    components: {
      default: () => import( /* webpackChunkName: "Search" */ '../views/Search.vue'),
    },
    meta:{
      title:"搜索",
      
    }
  },
  {
    path: '/myStudy',
    name: 'MyStudy',
    components: {
      default: () => import( /* webpackChunkName: "MyStudy" */ '../views/myStudy/MyStudy.vue'),
    },
    meta:{
      title:"我的学习",
      // login_require:true
    }
  },
  {
    path: '/courseInfo/:basis_id',
    name: 'CourseInfo',
    components: {
      default: () => import( /* webpackChunkName: "courseInfo" */ '../views/CourseInfo.vue'),
    },
    meta:{
      title:"课程",
      // login_require:true
    }
  },
  {
    path: '/date',
    name: 'Date',
    components: {
      default: () => import( /* webpackChunkName: "Date" */ '../views/date/Date.vue'),
    },
    meta:{
      title:"学习日历",
    }
  },
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
